package day1115_1;

import java.io.File;
import java.io.IOException;

public class Demo2 {
    public static void main(String[] args) throws IOException {
        File  b_txt=new File("D:\\b.txt");
        if( !b_txt.exists() ){//2.调用exists判断
            b_txt.createNewFile();
        }

        System.out.println(  b_txt.length()  );
        System.out.println(  b_txt.getParent()   );
        System.out.println(  b_txt.canExecute()  );//false
        System.out.println(  b_txt.renameTo(new File("D:\\C.txt")) );

        System.out.println( b_txt.isDirectory() );//false
        System.out.println( b_txt.lastModified() );
        b_txt.delete();

   /////--------------------------------------------------------
        File  dir2=new File("D:\\d1115");//1.创建对象
        if( !dir2.exists() ){//2.调用方法(操作)
            dir2.mkdir();
        }
    }
}











